package nc.ui.lm.invclass.set;

import nc.bs.logging.Logger;
import nc.ui.trade.business.HYPubBO_Client;
import nc.ui.trade.pub.IVOTreeDataByCode;
import nc.vo.lm.invclass.set.InvclassVO;
import nc.vo.pub.SuperVO;
import nc.vo.scm.pu.PuPubVO;

public class ChnlMemTypeTreeCardData implements IVOTreeDataByCode {
	
	public InvclassVO[] classvo = null;

	public String getCodeFieldName() {
		return "invclasscode";
	}

	public String getCodeRule() {
		return "2,2,2,2";
	}

	public String getShowFieldName() {
		return "codename";
	}

	public SuperVO[] getTreeVO() {
		if(classvo == null){
			try{
				classvo = (InvclassVO[])
				HYPubBO_Client.queryByCondition(InvclassVO.class, " isnull(dr,0) = 0 order by invclasscode ");
			}catch(Exception e){
				Logger.error(e);
			}
		}
        for(SuperVO vo:classvo){
            vo.setAttributeValue("codename",PuPubVO.getString_TrimZeroLenAsNull(vo.getAttributeValue("invclasscode"))+" "+PuPubVO.getString_TrimZeroLenAsNull(vo.getAttributeValue("invclassname")));
        }
		return classvo;
	}
}
